import React from 'react';
import { Button } from 'antd-mobile';
type Istate = {
  title: string;
};

// type Iprops = {
//   list: Object[];
// };

type ICart<T> = {
  hobby: string[];
  sayHi(name: T): void;
};

export default class Cart
  extends React.Component<any, Istate>
  implements ICart<string>
{
  hobby: string[];
  constructor(props: any) {
    super(props);
    this.hobby = ['xx'];
    this.state = {
      title: 'cart页面',
    };
  }

  sayHi(name: string) {}

  render(): React.ReactNode {
    return (
      <fieldset>
        <legend>Cart</legend>
        <h1>{this.state.title}</h1>
        <Button
          type="primary"
          onClick={() => {
            this.props.history.push('/home');
          }}
        >
          点击返回主页
        </Button>
      </fieldset>
    );
  }
}
